﻿@using XStudio.XCRF.Web.Models.Hospital
@{
    ViewBag.Title = "电子病历管理系统";
    Layout = "~/Views/Shared/Master.cshtml";
}

<h2>数据汇总</h2>

@(Html.Telerik().Grid<HospitalListModel>()
    .Name("HospitalGrid")
    .Columns(columns =>
    {
        columns.Bound(hospital => hospital.ID).Hidden();
        columns.Bound(hospital => hospital.Name).Sortable(true);
        columns.Bound(hospital => hospital.CRFCount).ClientTemplate(
            "<a href='javascript:CRFNumbers(\"<#= ID #>\");'><#= CRFCount #></a>"
        ).Title("病例数").Filterable(true);
    })
    .DataBinding(bind => bind.Ajax().Select<HomeController>(c => c._Index())
    ).Footer(false)
    
)
<script type="text/javascript">
    function CRFNumbers(id) {
        var url = "@(Url.Action<CRFController>(c => c.CRFList(Guid.Empty)))";
        url = url.replace("@Guid.Empty", id);
        window.location = url;
    }
</script>